#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.direname(File.dirname(File.realpath($PROGRAM_NAME)))
require "#{LKP_SRC}/lib/tests/stats"
stats = LKP::Stats.new

while (line = $stdin.gets)
  case line
  when /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} ([^()]+)$/
    case_name = $1.strip.tr(' ', '_')
  when /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (PASS|FAIL)ED \(\d+ secs\)/
    stats << case_name, $1.downcase
  end
end

stats.dump
